package com.landiao.common.weixin.bean;

import java.io.InputStream;
import java.io.Serializable;

import com.landiao.common.utils.XStreamInitializer;
import com.thoughtworks.xstream.XStream;

/**
 * 支付查询结果
 */
public class WxMpPayOrderQuery implements Serializable {
    private String return_code;
    private String return_msg;
    private String appid;
    private String mch_id;
    private String nonce_str;
    private String sign;
    private String result_code;
    private String prepay_id;
    private String trade_type;
    private String openid;
    private String trade_state;
    private String transaction_id;
    private String out_trade_no;
    private String time_end;
    private String trade_state_desc;
    private String total_fee;
    private String attach;

    public String getReturn_code() {
        return return_code;
    }

    public void setReturn_code(String return_code) {
        this.return_code = return_code;
    }

    public String getReturn_msg() {
        return return_msg;
    }

    public void setReturn_msg(String return_msg) {
        this.return_msg = return_msg;
    }

    public String getAppid() {
        return appid;
    }

    public void setAppid(String appid) {
        this.appid = appid;
    }

    public String getMch_id() {
        return mch_id;
    }

    public void setMch_id(String mch_id) {
        this.mch_id = mch_id;
    }

    public String getNonce_str() {
        return nonce_str;
    }

    public void setNonce_str(String nonce_str) {
        this.nonce_str = nonce_str;
    }

    public String getSign() {
        return sign;
    }

    public void setSign(String sign) {
        this.sign = sign;
    }

    public String getResult_code() {
        return result_code;
    }

    public void setResult_code(String result_code) {
        this.result_code = result_code;
    }

    public String getPrepay_id() {
        return prepay_id;
    }

    public void setPrepay_id(String prepay_id) {
        this.prepay_id = prepay_id;
    }

    public String getTrade_type() {
        return trade_type;
    }

    public void setTrade_type(String trade_type) {
        this.trade_type = trade_type;
    }

	public String getOpenid() {
		return openid;
	}

	public void setOpenid(String openid) {
		this.openid = openid;
	}

	public String getTrade_state() {
		return trade_state;
	}

	public void setTrade_state(String trade_state) {
		this.trade_state = trade_state;
	}

	public String getTransaction_id() {
		return transaction_id;
	}

	public void setTransaction_id(String transaction_id) {
		this.transaction_id = transaction_id;
	}

	public String getOut_trade_no() {
		return out_trade_no;
	}

	public void setOut_trade_no(String out_trade_no) {
		this.out_trade_no = out_trade_no;
	}

	public String getTime_end() {
		return time_end;
	}

	public void setTime_end(String time_end) {
		this.time_end = time_end;
	}
    
	public String getTrade_state_desc() {
		return trade_state_desc;
	}

	public void setTrade_state_desc(String trade_state_desc) {
		this.trade_state_desc = trade_state_desc;
	}

	public String getTotal_fee() {
		return total_fee;
	}

	public void setTotal_fee(String total_fee) {
		this.total_fee = total_fee;
	}

	@Override
	public String toString() {
		return "WxMpPayOrderQuery{" +
				"return_code='" + return_code + '\'' +
				", return_msg='" + return_msg + '\'' +
				", appid=" + appid +
				", mch_id='" + mch_id + '\'' +
				", nonce_str='" + nonce_str + '\'' +
				", sign=" + sign +
				", result_code='" + result_code + '\'' +
				", prepay_id='" + prepay_id + '\'' +
				", trade_type='" + trade_type + '\'' +
				", openid='" + openid + '\'' +
				", trade_state=" + trade_state +
				", transaction_id=" + transaction_id +
				", out_trade_no=" + out_trade_no +
				", time_end='" + time_end + '\'' +
				", trade_state_desc='" + trade_state_desc + '\'' +
				", total_fee='" + total_fee + '\'' +
				'}';
	}

	public static WxMpPayOrderQuery fromXml(String xml) {
    	XStream xstream = XStreamInitializer.getInstance();
    	xstream.alias("xml", WxMpPayOrderQuery.class);
    	return (WxMpPayOrderQuery)xstream.fromXML(xml);
    }

    public static WxMpPayOrderQuery fromXml(InputStream is) {
    	XStream xstream = XStreamInitializer.getInstance();
    	xstream.alias("xml", WxMpPayOrderQuery.class);
    	return (WxMpPayOrderQuery)xstream.fromXML(is);
    }

	public String getAttach() {
		return attach;
	}

	public void setAttach(String attach) {
		this.attach = attach;
	}
}
